<template>
  <div class="main">
    <el-container class="main-container">
      <el-aside :width="isCollapse ? '60px' : '210px'">
        <nav-menu :collapse="isCollapse"></nav-menu>
      </el-aside>
      <el-container class="page">
        <el-header>
          <nav-header @fold-change="handleFoldChange"></nav-header>
        </el-header>
        <el-main class="page-container">
          <el-scrollbar>
            <div class="page-info">
              <router-view></router-view>
            </div>
          </el-scrollbar>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import navMenu from '@/components/nav-menu'
import navHeader from '@/components/nav-header'
const isCollapse = ref(false)
const handleFoldChange = (isFold: boolean) => {
  isCollapse.value = isFold
}
</script>

<style lang="less" scoped>
.main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  .main-container,
  .page {
    height: 100%;
    .el-header {
      height: 48px !important;
      display: flex;
      color: #333;
      text-align: center;
      align-items: center;
    }
    .page-container {
      height: calc(100% - 48px);
      .page-info {
        background-color: #fff;
        border-radius: 5px;
      }
    }
    .el-main {
      color: #333;
      text-align: center;
      background-color: #f0f2f5;
    }
  }
  .el-aside {
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 200px;
    text-align: left;
    cursor: pointer;
    background-color: #001529;
    transition: width 0.3s linear;
    scrollbar-width: none;
    /* firefox */
    -ms-overflow-style: none;
    /* IE 10+ */

    &::-webkit-scrollbar {
      display: none;
    }
  }
}
</style>
